﻿//==========================================================
// 此代码由TilverNET代码生成工具自动生成，请不要修改
// 代码生成器版本号：1.2
// 作者：landy
// 联系方式：(QQ)86566178
// 创建时间：2014-10-13 11:00:48
//==========================================================

using System;
using System.Text;
using System.Data;
using System.Data.Common;
using System.Collections.Generic;
using System.Linq;
using Tilver.Data;
using Tilver.Data.DataPager;

namespace Weather.DAL.CoWeather
{
	#region EO

	/// <summary>
	///  《dbo.Fcst_Image_Rain(实体类)》
	/// </summary>
	[Serializable]
	public class FcstImageRainEO : IRowMapper<FcstImageRainEO>
	{
		protected long _id;
		protected int _date;
		protected string _time;
		protected string _stationnum;
		protected byte[] _data;
		protected string _subfix;
		protected string _timeInterval;
		protected DateTime? _renewtime;


		/// <summary>
		///  《[字段]  [bigint]   自增字段》
		/// </summary>
		public long Id
		{
			get { return _id; }
			set { _id = value;}
		}

		/// <summary>
		///  《[字段]  [int]》
		/// </summary>
		public int Date
		{
			get { return _date; }
			set { _date = value;}
		}

		/// <summary>
		///  《[字段]  [nvarchar]》
		/// </summary>
		public string Time
		{
			get { return _time; }
			set {
				if (value == null || value.Length > 4)
					throw new ArgumentOutOfRangeException("Invalid value for Time", value, value == null ? "null" : value.ToString());
				_time = value;
			}
		}

		/// <summary>
		///  《[字段]  [nvarchar]》
		/// </summary>
		public string Stationnum
		{
			get { return _stationnum; }
			set {
				if (value == null || value.Length > 5)
					throw new ArgumentOutOfRangeException("Invalid value for Stationnum", value, value == null ? "null" : value.ToString());
				_stationnum = value;
			}
		}

		/// <summary>
		///  《[字段]  [image]》
		/// </summary>
		public byte[] Data
		{
			get { return _data; }
			set { _data = value;}
		}

		/// <summary>
		///  《[字段]  [nvarchar]》
		/// </summary>
		public string Subfix
		{
			get { return _subfix; }
			set {
				if (value != null && value.Length > 5)
					throw new ArgumentOutOfRangeException("Invalid value for Subfix", value, value == null ? "null" : value.ToString());
				_subfix = value;
			}
		}

		/// <summary>
		///  《[字段]  [nvarchar]》
		/// </summary>
		public string TimeInterval
		{
			get { return _timeInterval; }
			set {
				if (value != null && value.Length > 3)
					throw new ArgumentOutOfRangeException("Invalid value for TimeInterval", value, value == null ? "null" : value.ToString());
				_timeInterval = value;
			}
		}

		/// <summary>
		///  《[字段]  [datetime]》
		/// </summary>
		public DateTime? Renewtime
		{
			get { return _renewtime; }
			set { _renewtime = value;}
		}

		/// <summary>
		/// 默认构造函数
		/// </summary>
		public FcstImageRainEO() 
		{
			Time = string.Empty;
			Stationnum = string.Empty;
		}

		/// <summary>
		/// 自定义构造函数
		/// </summary>
		/// <param name = "id"></param>
		/// <param name = "date"></param>
		/// <param name = "time"></param>
		/// <param name = "stationnum"></param>
		/// <param name = "data"></param>
		/// <param name = "subfix"></param>
		/// <param name = "timeInterval"></param>
		/// <param name = "renewtime"></param>
		public FcstImageRainEO(long id, int date, string time, string stationnum, byte[] data, string subfix, string timeInterval, DateTime? renewtime) 
		{
			_id = id;
			_date = date;
			_time = time;
			_stationnum = stationnum;
			_data = data;
			_subfix = subfix;
			_timeInterval = timeInterval;
			_renewtime = renewtime;
		}


		/// <summary>
		/// 将结果集映射成实体对象
		/// </summary>
		/// <param name = "reader">只进结果集流</param>
		/// <return></return>
		public FcstImageRainEO MapRow(IDataReader reader)
		{
			var ret = new FcstImageRainEO();
			ret.Id = (long)reader["id"];
			ret.Date = (int)reader["date"];
			ret.Time = (string)reader["time"];
			ret.Stationnum = (string)reader["stationnum"];
			ret.Data = (reader["data"] is DBNull) ? null : (byte[])reader["data"];
			ret.Subfix = (reader["subfix"] is DBNull) ? null : (string)reader["subfix"];
			ret.TimeInterval = (reader["time_interval"] is DBNull) ? null : (string)reader["time_interval"];
			ret.Renewtime = (reader["renewtime"] is DBNull) ? null : (DateTime?)reader["renewtime"];
			return ret;
		}

		/// <summary>
		/// 将结果集映射成实体对象，返回映射方法
		/// </summary>
		/// <return></return>
		public Func<IDataReader, FcstImageRainEO> GetMapper()
		{
			return MapRow;
		}


	}


	#endregion
	#region MO

	/// <summary>
	///  《dbo.Fcst_Image_Rain(逻辑类)》
	/// </summary>
	public class FcstImageRainMO : DbManagerBase
	{

		#region 构造函数
		/// <summary>
		/// 构造函数
		/// </summary>
		/// <param name = "routeData">路由数据</param>
		public FcstImageRainMO(object routeData = null) : base(routeData) { }

		/// <summary>
		/// 构造函数
		/// </summary>
		/// <param name = "connectionStringName">连接字符串名称</param>
		public FcstImageRainMO(string connectionStringName) : base(connectionStringName) { }

		#endregion

		#region 私有方法
		/// <summary>
		/// 数据库访问操作方法
		/// </summary>
		/// <param name = "sql">SQL语句</param>
		/// <return>返回数据操作对象</return>
		private DbAdoBase AdoBase(string sql)
		{
			return DataBase.CreateDbAdo(sql, CommandType.Text);
		}

		#endregion

		#region Select方法集合

		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "id"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<FcstImageRainEO> SelectById(long id, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [id], [date], [time], [stationnum], [data], [subfix], [time_interval], [renewtime] FROM [dbo].[Fcst_Image_Rain] WHERE [id]=@Id");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Id", id, DbType.Int64, 8)
							.ExecuteList(new FcstImageRainEO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "date"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<FcstImageRainEO> SelectByDate(int date, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [id], [date], [time], [stationnum], [data], [subfix], [time_interval], [renewtime] FROM [dbo].[Fcst_Image_Rain] WHERE [date]=@Date");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Date", date, DbType.Int32, 4)
							.ExecuteList(new FcstImageRainEO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "time"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<FcstImageRainEO> SelectByTime(string time, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [id], [date], [time], [stationnum], [data], [subfix], [time_interval], [renewtime] FROM [dbo].[Fcst_Image_Rain] WHERE [time]=@Time");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Time", time, DbType.String, 4)
							.ExecuteList(new FcstImageRainEO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "stationnum"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<FcstImageRainEO> SelectByStationnum(string stationnum, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [id], [date], [time], [stationnum], [data], [subfix], [time_interval], [renewtime] FROM [dbo].[Fcst_Image_Rain] WHERE [stationnum]=@Stationnum");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Stationnum", stationnum, DbType.String, 5)
							.ExecuteList(new FcstImageRainEO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "data"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<FcstImageRainEO> SelectByData(byte[] data, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [id], [date], [time], [stationnum], [data], [subfix], [time_interval], [renewtime] FROM [dbo].[Fcst_Image_Rain] WHERE [data]=@Data");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Data", data, DbType.Binary, 16)
							.ExecuteList(new FcstImageRainEO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "subfix"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<FcstImageRainEO> SelectBySubfix(string subfix, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [id], [date], [time], [stationnum], [data], [subfix], [time_interval], [renewtime] FROM [dbo].[Fcst_Image_Rain] WHERE [subfix]=@Subfix");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Subfix", subfix, DbType.String, 5)
							.ExecuteList(new FcstImageRainEO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "timeInterval"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<FcstImageRainEO> SelectByTimeInterval(string timeInterval, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [id], [date], [time], [stationnum], [data], [subfix], [time_interval], [renewtime] FROM [dbo].[Fcst_Image_Rain] WHERE [time_interval]=@TimeInterval");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@TimeInterval", timeInterval, DbType.String, 3)
							.ExecuteList(new FcstImageRainEO().GetMapper(), tm);
		}
		/// <summary>
		/// 按字段查询
		/// </summary>
		/// <param name = "renewtime"></param>
		/// <param name = "top">获取记录数，当top值小于或等于0时忽略top条件</param>
		/// <param name = "sort">排序表达式，如：field1 ASC,field2 DESC</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<FcstImageRainEO> SelectByRenewtime(DateTime? renewtime, int top, string sort, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [id], [date], [time], [stationnum], [data], [subfix], [time_interval], [renewtime] FROM [dbo].[Fcst_Image_Rain] WHERE [renewtime]=@Renewtime");
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddInParameter("@Renewtime", renewtime, DbType.DateTime, 8)
							.ExecuteList(new FcstImageRainEO().GetMapper(), tm);
		}

		/// <summary>
		/// 按自定义条件查询
		/// </summary>
		/// <param name = "where">自定义条件,where子句</param>
		/// <param name = "top">获取行数</param>
		/// <param name = "sort">排序表达式</param>
		/// <param name = "paras">where子句中定义的参数集合</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public List<FcstImageRainEO> Select(string where, int top, string sort, IEnumerable<DbParameter> paras, TransactionManager tm = null)
		{
			var sql = new StringBuilder();
			var format = new StringBuilder();
			format.Append(@"SELECT {0} [id], [date], [time], [stationnum], [data], [subfix], [time_interval], [renewtime] FROM [dbo].[Fcst_Image_Rain] ");
			if (!string.IsNullOrEmpty(where)) format.AppendFormat(" WHERE {0} ", where);
			if (!string.IsNullOrEmpty(sort)) format.AppendFormat(" ORDER BY {0} ", sort);
			sql.AppendFormat(format.ToString(), (top > 0) ? string.Format("TOP {0}", top) : string.Empty);
			return AdoBase(sql.ToString())
							.AddParameters(paras)
							.ExecuteList(new FcstImageRainEO().GetMapper(), tm);
		}

		/// <summary>
		/// 分页查询
		/// </summary>
		/// <param name = "where">条件表达式</param>
		/// <param name = "sort">排序表达式</param>
		/// <param name = "paras">传入参数</param>
		/// <param name = "pageSize">页大小</param>
		/// <param name = "pageIndex">页码</param>
		/// <param name = "recordCount">总记录数，由于计算总记录数影响数据库性能，只有小于或等于0的情况下才返回总记录数</param>
		/// <return>分页数据</return>
		public List<FcstImageRainEO> SelectPager(string where, string sort, IList<DbParameter> paras, long pageSize, long pageIndex, ref long recordCount)
		{
			var sql = new StringBuilder();
			sql.AppendFormat(@"SELECT [id], [date], [time], [stationnum], [data], [subfix], [time_interval], [renewtime] FROM [dbo].[Fcst_Image_Rain]");
			if (!string.IsNullOrEmpty(where)) sql.AppendFormat(" WHERE {0} ", where);
			if (!string.IsNullOrEmpty(sort)) sql.AppendFormat(" ORDER BY {0} ", sort);
			var pager = this.DataBase.CreatePager(sql.ToString(), pageSize);
			pager.AddParameters(paras);
			if (recordCount <= 0)
			{
				recordCount = pager.GetRecordCount();
			}
			return pager.GetPageData(pageIndex).MapToList(new FcstImageRainEO().GetMapper());
		}

		#endregion

		#region Insert方法集合
		/// <summary>
		/// 插入数据，有自增列时，item中自增字段为新增值，否则，返回影响的行数
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "item">要插入的实体对象</param>
		/// <return></return>
		public int Insert(FcstImageRainEO item, TransactionManager tm = null)
		{
			const string sql = @"INSERT INTO [dbo].[Fcst_Image_Rain] ([date], [time], [stationnum], [data], [subfix], [time_interval], [renewtime]) VALUES (@date, @time, @stationnum, @data, @subfix, @time_interval, @renewtime) ;SELECT SCOPE_IDENTITY();";
			item.Id = long.Parse(AdoBase(sql)
												.AddInParameter("@date", item.Date, DbType.Int32, 4)
												.AddInParameter("@time", item.Time, DbType.String, 4)
												.AddInParameter("@stationnum", item.Stationnum, DbType.String, 5)
												.AddInParameter("@data", item.Data != null ?  (object)item.Data : DBNull.Value, DbType.Binary, 16)
												.AddInParameter("@subfix", item.Subfix != null ?  (object)item.Subfix : DBNull.Value, DbType.String, 5)
												.AddInParameter("@time_interval", item.TimeInterval != null ?  (object)item.TimeInterval : DBNull.Value, DbType.String, 3)
												.AddInParameter("@renewtime", item.Renewtime.HasValue ? (object)item.Renewtime.Value : DBNull.Value, DbType.DateTime, 8)
												.ExecuteScalar(tm).ToString());
			return 1;
		}
		#endregion

		#region Update方法集合
		/// <summary>
		/// 按自定义条件更新数据
		/// </summary>
		/// <param name = "set">更新列</param>
		/// <param name = "where">更新条件</param>
		/// <param name = "paras">参数集合</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public int Update(string set, string where, IEnumerable<DbParameter> paras, TransactionManager tm = null)
		{
			if (string.IsNullOrEmpty(set)) throw new ArgumentNullException("set");
			var sql = string.Format(@"UPDATE [dbo].[Fcst_Image_Rain] SET {0} {1}", set, (string.IsNullOrEmpty(where) ? string.Empty : " WHERE " + where));
			return AdoBase(sql)
							.AddParameters(paras)
							.ExecuteNonQuery(tm);
		}
		#endregion

		#region Delete方法集合
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "id"></param>
		public int DeleteById(long id, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[Fcst_Image_Rain] WHERE [id]=@id";
			return AdoBase(sql)
							.AddInParameter("@id", id, DbType.Int64, 8)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "date"></param>
		public int DeleteByDate(int date, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[Fcst_Image_Rain] WHERE [date]=@date";
			return AdoBase(sql)
							.AddInParameter("@date", date, DbType.Int32, 4)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "time"></param>
		public int DeleteByTime(string time, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[Fcst_Image_Rain] WHERE [time]=@time";
			return AdoBase(sql)
							.AddInParameter("@time", time, DbType.String, 4)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "stationnum"></param>
		public int DeleteByStationnum(string stationnum, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[Fcst_Image_Rain] WHERE [stationnum]=@stationnum";
			return AdoBase(sql)
							.AddInParameter("@stationnum", stationnum, DbType.String, 5)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "data"></param>
		public int DeleteByData(byte[] data, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[Fcst_Image_Rain] WHERE [data]=@data";
			return AdoBase(sql)
							.AddInParameter("@data", data != null ?  (object)data : DBNull.Value, DbType.Binary, 16)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "subfix"></param>
		public int DeleteBySubfix(string subfix, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[Fcst_Image_Rain] WHERE [subfix]=@subfix";
			return AdoBase(sql)
							.AddInParameter("@subfix", subfix != null ?  (object)subfix : DBNull.Value, DbType.String, 5)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "timeInterval"></param>
		public int DeleteByTimeInterval(string timeInterval, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[Fcst_Image_Rain] WHERE [time_interval]=@time_interval";
			return AdoBase(sql)
							.AddInParameter("@time_interval", timeInterval != null ?  (object)timeInterval : DBNull.Value, DbType.String, 3)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 按字段删除
		/// </summary>
		/// <param name="tm">事务管理对象</param>
		/// <param name = "renewtime"></param>
		public int DeleteByRenewtime(DateTime? renewtime, TransactionManager tm = null)
		{
			const string sql = @"DELETE FROM [dbo].[Fcst_Image_Rain] WHERE [renewtime]=@renewtime";
			return AdoBase(sql)
							.AddInParameter("@renewtime", renewtime.HasValue ? (object)renewtime.Value : DBNull.Value, DbType.DateTime, 8)
							.ExecuteNonQuery(tm);
		}
		/// <summary>
		/// 删除指定条件的记录
		/// </summary>
		/// <param name = "whereClause">自定义删除条件，where子句。如：id=1 and name='aaa'</param>
		/// <param name = "paras">where子句中定义的参数集合</param>
		/// <param name="tm">事务管理对象</param>
		/// <return></return>
		public int Delete(string whereClause, IEnumerable<DbParameter> paras, TransactionManager tm = null)
		{
			var sql = string.Format(@"DELETE FROM [dbo].[Fcst_Image_Rain] {0}", (string.IsNullOrEmpty(whereClause) ? string.Empty : " WHERE " + whereClause));
			return AdoBase(sql)
							.AddParameters(paras)
							.ExecuteNonQuery(tm);
		}
		#endregion

		#region  自定义方法集合
		#endregion

	}


	#endregion
}
